<#include "/common/layout.html"> 
<@layout title="123">
<script type="text/javascript">
var model_name = "/shop";
var model_title="商户列表";
var datagrid;
	$(function() {
		datagrid=$('#form_datagrid').treegrid({
		 	url:model_name+'/treeDataGrid/',
		 	rownumbers:true,
			fit:true,
			fitColumns:false,
			nowrap:false,
			animate:false,
			border:false,
			idField:'id',
			treeField:'name',
			pagination:true,
			toolbar:'#tb',
			frozenColumns:[ [ {
				title:'id',
				field:'id',
				hidden:true
			},{
				field:'name',
				title:'名称',
				width:180
			} ] ],
		 	columns:[[    
		 		{field:'pid',title:'上级分类',
					formatter : function(value, rowData, rowIndex) {
						return rowData.pname;
					}},
		        {field:'id',title:'编号',hidden:true},
		        {field:'address',title:'商户地址'},
		        {field:'phone',title:'商户电话'},
		        {field:'logo',title:'商户图片',
		       		formatter:function(value,row,index){
		        	if(value)
		        	return "<span url='"+value+"' style='cursor:pointer;color:blue;'  onmouseover='hoverShow(this);'onmouseout='$(\"#imgShow\").hide();'>"+value+"</span>";
		        }},
		        {field:'work_hours',title:'工作时间'},
		        {field:'create_time',title:'创建时间'},
		        {field:'update_time',title:'修改时间'}
		    ]],
		    onBeforeExpand:function(row){  
		        //动态设置展开查询的url  
		        var url = model_name+'/treeDataGrid/'+row.id;
		        datagrid.treegrid("options").url = url;  
		        return true;      
		    }
		})
	})
</script>
<script type="text/javascript" src="/js/easyui/easyui_grid_common.js"></script>
</head>
<div id="tb">
<a href="javascript:void(0)" onclick="expandAll();" class="easyui-linkbutton" data-options="iconCls:'icon-redo',plain:true">展开</a>
<a href="javascript:void(0)" onclick="collapseAll();" class="easyui-linkbutton" data-options="iconCls:'icon-undo',plain:true">折叠</a>
<a href="javascript:void(0)" onclick="reload();" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true">刷新</a>
<a href="javascript:void(0)" onclick="view();" class="easyui-linkbutton" data-options="iconCls:'icon-redo',plain:true">查看</a>
<a href="javascript:void(0)" onclick="add();" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">增加</a>
<a href="javascript:void(0)" onclick="del();"class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true">删除</a>
<a href="javascript:void(0)" onclick="edit();" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">编辑</a>
<a href="javascript:void(0)" onclick="datagrid.treegrid('unselectAll');" class="easyui-linkbutton" data-options="iconCls:'icon-undo',plain:true">取消选中</a>
</div>
	<#include "/common/seach.html" />
	<@seach>
	<td>商户名称</td>
	<td><input type="text" name="seachLike_name"></li></td>
	</@seach>
</@layout>